Sys.Application.add_init(PageInit);

function PageInit() {
    WriteLine('Init Start');
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_beginRequest(BeginRequest);
    prm.add_initializeRequest(InitRequest);
    prm.add_pageLoading(PageLoading);
    
    WriteLine('Init End');
}   

function InitRequest (sender, initializeEventArgs) {
    debugger;
    WriteLine('in init of Update Panel Request');
}

function BeginRequest(sender, beginRequestEventArgs) {
    WriteLine('in being req');
}

function PageLoading(sender, pageLoadingEventArgs) {
    WriteLine('in Page Loading');
}

function WriteLine (value) {
    if(window.debugService) {
        window.debugService.trace(value);
    }   
}